package com.me.mygdxgame;

import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;
import com.me.mygdxgame.Components.Attack;
import com.me.mygdxgame.Components.BoundingBox;
import com.me.mygdxgame.Components.Fortify;
import com.me.mygdxgame.Components.Health;
import com.me.mygdxgame.Components.TilebasedCharacterController;
import com.me.mygdxgame.Components.Transform;
import com.me.mygdxgame.GameObjects.Unit;

public class ShotgunFactory extends AbstractFactory {

	private final static int maxHP = 120;
	
	@Override
	public GameObject create(Vector2 position) {
		Unit unit = new Unit();
		int size = Map.getTileSize();
		Transform transform = new Transform(position, new Vector2(1,1),new Vector2(size, size) );
		Rectangle boxRectangle = new Rectangle(position.x, position.y, size, size);
		BoundingBox boundingBox = new BoundingBox(boxRectangle);
		Health health  = new Health(maxHP);
		
		unit.addComponent(transform);
		unit.addComponent(boundingBox);
		unit.addComponent(health);
		unit.addComponent(new Attack(10));
		unit.addComponent(new Fortify());
		unit.addComponent(new TilebasedCharacterController(transform));
		unit.setUnitType(UNITTYPE.SHOTGUN);
		return unit;
	}

}
